package com.zjdiepu.www.manage.view;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.zjdiepu.www.base.BaseController;
import com.zjdiepu.www.base.enums.type.DataDicType;
import com.zjdiepu.www.commpent.ViewScopeControllerHelper;
import com.zjdiepu.www.ibiz.cache.ICachedDictionaryService;

/**
 * 经销商Controller层<br/>
 * @author xiongxiaotun<br/>
 * @time 2017年05月11日 20时36分<br/>
 * @since 1.0<br/>
 */
@Controller
@RequestMapping(value= "DpBaseContractVersionController", produces="text/html;charset=UTF-8")
@Api(tags = {"经销商"}, produces="text/html;charset=UTF-8")
public class DpBaseContractVersionController extends BaseController {
    @Resource
    private ViewScopeControllerHelper viewScopeControllerHelper;
    @Resource
    private ICachedDictionaryService cachedDictionaryService;
    
    /**
     * @author xiongxiaotun <br/>
     * @Title: toUpdate <br/>
     * @Description: 经销商修改 <br/>
     * @param model
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "合同版本修改", response = Boolean.class, httpMethod="GET", tags={"经销商"})
    @RequestMapping(value = "toUpdate", method = RequestMethod.GET)
    public String toUpdate(Model model) {
    	model.addAttribute("dealerLevel", cachedDictionaryService.getValueNamesWithSpaceOption(DataDicType.DEALER_LEVEL,"请选择..."));
    	
    	viewScopeControllerHelper.preparedRegin(model,null,null);
    	return "system/base/contractVersionUpdate";
    }
	
    /**
     * @author xiongxiaotun <br/>
     * @Title: toUpdate <br/>
     * @Description: 经销商新增 <br/>
     * @param model
     * @return
     * @version V1.0  <br/>
     */
    @ApiOperation(value = "合同版本新增", response = Boolean.class, httpMethod="GET", tags={"经销商"})
    @RequestMapping(value = "toSave", method = RequestMethod.GET)
    public String toSave(Model model) {
    	model.addAttribute("dealerLevel", cachedDictionaryService.getValueNamesWithSpaceOption(DataDicType.DEALER_LEVEL,"请选择..."));
    	viewScopeControllerHelper.preparedRegin(model,null,null);
    	return "system/base/contractVersionAdd";
    }
}
